package org.jeecg.modules.wlhy.tlaccount.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.jeecg.modules.wlhy.hypfaccount.entity.HyPfAccount;
import org.jeecg.modules.wlhy.tlaccount.entity.HyTlAccount;
import org.jeecg.modules.wlhy.tlaccount.mapper.HyTlAccountMapper;
import org.jeecg.modules.wlhy.tlaccount.service.IHyTlAccountService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.math.BigDecimal;
import java.util.List;
import java.util.Set;

/**
 * @Description: hy_tl_account
 * @Author: jeecg-boot
 * @Date:   2022-10-07
 * @Version: V1.0
 */
@Service
public class HyTlAccountServiceImpl extends ServiceImpl<HyTlAccountMapper, HyTlAccount> implements IHyTlAccountService {

//    @Override
//    public HyTlAccount getByBizUserId(String bizUserId) {
//        return baseMapper.selectOne(new QueryWrapper<HyTlAccount>().eq("biz_user_id" , bizUserId));
//    }
//
//    @Override
//    public HyTlAccount getByBizUserIdForUpdate(String bizUserId) {
//        return baseMapper.getByBizUserIdForUpdate(bizUserId);
//    }

    @Override
    public HyTlAccount getByIdForUpdate(String id) {
        return baseMapper.getByIdForUpdate(id);
    }

    @Override
    public HyTlAccount getByUid(String uid) {
        return baseMapper.selectOne(new QueryWrapper<HyTlAccount>().eq("uid" , uid));
    }

    @Override
    public HyTlAccount getByUidForUpdate(String uid) {
        return baseMapper.getByUidForUpdate(uid);
    }

    @Override
    public List<HyTlAccount> getCarrierAccounts(Set<String> carrierSet) {
        return this.list(new QueryWrapper<HyTlAccount>().in("uid", carrierSet).eq("utype", "5"));
    }

    @Override
    public List<HyTlAccount> getDriverAccounts(Set<String> driverSet) {
        return this.list(new QueryWrapper<HyTlAccount>().in("uid", driverSet).eq("utype", "4"));
    }

    @Override
    public BigDecimal getCompanyCostService() {
        return baseMapper.getCompanyCostService();
    }
}
